/**
 * 
 */
package com.surelution.lansao.wxmp

import com.surelution.lansao.Member
import com.surelution.lansao.Partner
import com.surelution.whistle.core.Attribute;
import com.surelution.whistle.core.BaseAction

/**
 * @author <a href="mailto:guangzong.syu@gmail.com">Guangzong</a>
 *
 */
abstract class BaseLansaoAction extends BaseAction {
	
	protected Member getMember() {
		String name = getParam(Attribute.KEY_FromUserName)
		if(name) {
			return Member.findByOpenId(name)
		}
		return null;
	}
	
	protected Partner getPartner() {
		String name = getParam(Attribute.KEY_ToUserName)
		if(name) {
			return Partner.findByWxOpenId(name)
		}
		return null
	}
}
